package com.cai310.lottery.fetch.jclq;

import java.util.Map;

import org.apache.commons.lang.StringUtils;

import com.cai310.lottery.support.jclq.PassMode;
import com.cai310.lottery.support.jclq.PlayType;

public class JclqDXFPassFetchParser extends JclqSimplePassFetchParser {

	@Override
	public String getSourceUrl() {
		return "http://info.sporttery.cn/basketball/hilo_list.php";
	}

	@Override
	public PlayType getPlayType() {
		return PlayType.DXF;
	}

	@Override
	public PassMode getPassMode() {
		return PassMode.PASS;
	}

	@Override
	protected void handleReducedValue(Map<String, Double> itemMap, String reducedValueStr) {
		Double value;
		if (StringUtils.isNotBlank(reducedValueStr)) {
			reducedValueStr = reducedValueStr.trim().replaceAll("\\+", "");
			value = Double.valueOf(reducedValueStr);
		} else {
			value = 0d;
		}
		itemMap.put(REDUCED_VALUE_KEY, value);
	}
}